package com.ruoyi.purchase.service.impl;

import java.util.List;

import com.ruoyi.purchase.mapper.PurchaseApplyMaterialMapper;
import com.ruoyi.purchase.pojo.PurchaseApplyMaterial;
import com.ruoyi.purchase.service.PurchaseApplyMaterialService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
 * 采购申请清单Service业务层处理
 *
 * @author ruoyi
 * @date 2024-10-25
 */
@Service
public class PurchaseApplyMaterialServiceImpl implements PurchaseApplyMaterialService
{
    @Autowired
    private PurchaseApplyMaterialMapper purchaseApplyMaterialMapper;

    /**
     * 查询采购申请清单ApplyId
     *
     * @param id 采购申请清单主键
     * @return 采购申请清单
     */
    @Override
    public PurchaseApplyMaterial selectPurchaseApplyMaterialById(Integer id)
    {
        return purchaseApplyMaterialMapper.selectPurchaseApplyMaterialById(id);
    }

    /***
     * 查询采购申请清单
     * @param id
     * @return
     */
    @Override
    public PurchaseApplyMaterial selectPurchaseApply(Integer id) {
        return purchaseApplyMaterialMapper.selectPurchaseApply(id);
    }

    /**
     * 查询采购申请清单列表
     *
     * @param purchaseApplyMaterial 采购申请清单
     * @return 采购申请清单
     */
    @Override
    public List<PurchaseApplyMaterial> selectPurchaseApplyMaterialList(PurchaseApplyMaterial purchaseApplyMaterial)
    {
        return purchaseApplyMaterialMapper.selectPurchaseApplyMaterialList(purchaseApplyMaterial);
    }

    /**
     * 新增采购申请清单
     *
     * @param purchaseApplyMaterial 采购申请清单
     * @return 结果
     */
    @Override
    public int insertPurchaseApplyMaterial(PurchaseApplyMaterial purchaseApplyMaterial)
    {
        return purchaseApplyMaterialMapper.insertPurchaseApplyMaterial(purchaseApplyMaterial);
    }

    /**
     * 修改采购申请清单
     *
     * @param purchaseApplyMaterial 采购申请清单
     * @return 结果
     */
    @Override
    public int updatePurchaseApplyMaterial(PurchaseApplyMaterial purchaseApplyMaterial)
    {
        return purchaseApplyMaterialMapper.updatePurchaseApplyMaterial(purchaseApplyMaterial);
    }

    @Override
    public int deletePurchaseApplyMaterialByIds(Integer[] ids) {
        return purchaseApplyMaterialMapper.deletePurchaseApplyMaterialByIds(ids);
    }

    /**
     * 删除采购申请清单信息
     *
     * @param id 采购申请清单主键
     * @return 结果
     */
    @Override
    public int deletePurchaseApplyMaterialById(Integer id)
    {
        return purchaseApplyMaterialMapper.deletePurchaseApplyMaterialById(id);
    }

    /**
     * 根据purchase_apply_id值删除数据
     * @param purchaseApplyId
     * @return
     */
    @Override
    public int deletePurchaseApplyMaterialByApplyId(Integer purchaseApplyId) {
        return purchaseApplyMaterialMapper.deletePurchaseApplyMaterialByApplyId(purchaseApplyId);
    }


}

